Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security Hub - get_findings and batch_import_findings #8518

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

Singha22
Copy link
Contributor

@Singha22 Singha22 commented Jan 23, 2025

Resolves #8493

get_findings contains code for only these 2 parameters out of the 4 parameters

next_token: Optional[str] = None,
max_results: Optional[int] = None,

Copy link

codecov bot commented Jan 24, 2025

Codecov Report

Attention: Patch coverage is 91.86047% with 7 lines in your changes missing coverage. Please review.

Project coverage is 92.62%. Comparing base (16abebb) to head (541b7a3).

Files with missing lines Patch % Lines
moto/securityhub/models.py 87.23% 6 Missing ⚠️
moto/securityhub/responses.py 96.15% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8518      +/-   ##
==========================================
- Coverage   92.63%   92.62%   -0.01%     
==========================================
  Files        1229     1234       +5     
  Lines      106394   106480      +86     
==========================================
+ Hits        98553    98632      +79     
- Misses       7841     7848       +7     
Flag Coverage Δ
servertests 27.89% <0.00%> (-0.03%) ⬇️
unittests 92.60% <91.86%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Singha22 Singha22 changed the title aws - securityhub - getfindings Security Hub - get_findings and batch_import_findings Jan 27, 2025
@Singha22 Singha22 marked this pull request as ready for review January 28, 2025 16:07
Copy link
Collaborator

@bblommers bblommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Singha22, thank you for getting started on this new service!

The implementation looks mostly OK to me - I just have one request to simplify the pagination-implementation a bit.

op="GetFindings", msg="MaxResults must be a number greater than 0"
)

paginator = Paginator(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like we can just use the @paginate-decorator on the method here, that should simplify the implementation a bit.

Please see the docs here: https://docs.getmoto.org/en/latest/docs/contributing/development_tips/utilities.html#paginator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Security Hub Service Enhancement: GetFindings
2 participants